

package com.hazelcast.internal.management.events;

import com.hazelcast.internal.json.JsonObject;

import java.util.UUID;

import static com.hazelcast.internal.management.events.EventMetadata.EventType.WAN_CONSISTENCY_CHECK_FINISHED;

public class WanConsistencyCheckFinishedEvent extends AbstractWanAntiEntropyEventBase {
    private final int diffCount;
    private final int checkedCount;
    private final int entriesToSync;

    public WanConsistencyCheckFinishedEvent(UUID uuid, String wanReplicationName, String wanPublisherId, String mapName, int diffCount, int checkedCount, int entriesToSync) {
        super(uuid, wanReplicationName, wanPublisherId, mapName);
        this.diffCount = diffCount;
        this.checkedCount = checkedCount;
        this.entriesToSync = entriesToSync;
    }

    @Override
    public EventMetadata.EventType getType() {
        return WAN_CONSISTENCY_CHECK_FINISHED;
    }

    @Override
    public JsonObject toJson() {
        JsonObject json = super.toJson();
        json.add("diffCount", diffCount);
        json.add("checkedCount", checkedCount);
        json.add("entriesToSync", entriesToSync);
        return json;
    }
}
